function Person(name,age,height,address){
    // 方式一(有問題)
    // Person.prototype.name = name,
    // Person.prototype.age = age,
    // Person.prototype.height = height,
    // Person.prototype.address = address
    // 方式二
    this.name = name,
    this.age = age,
    this.height = height,
    this.address = address
}

Person.prototype.eating = function(){
    console.log(this.name +"在吃東西")
}

Person.prototype.running = function(){
    console.log(this.name +"在跑步")
}




var p1 = new Person("why",18,1.88,"广州市")
var p2 = new Person("scott",18,1.88,"深圳市")

p1.eating()
p2.eating()